package moe.bogos.douro.api.common.capabilities;

import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.INBT;
import net.minecraft.util.Direction;
import net.minecraftforge.common.capabilities.Capability;

public class CapMapStorage implements Capability.IStorage<ICapMap>
{
    public static final CapMapStorage MAP_CAP_STORAGE = new CapMapStorage();
    
    public INBT writeNBT(Capability<ICapMap> capability, ICapMap instance, Direction side)
    {
        return instance.getMap();
    }
    
    public void readNBT(Capability<ICapMap> capability, ICapMap instance, Direction side, INBT nbt)
    {
        instance.setMap((CompoundNBT) nbt);
    }
}
